{% extends 'base.html' %}

{% block content %}
    <div class="container">
        <div class="row">
            <form action="" method="post">
                {% csrf_token %}
                <div class="form-group">
                    <label for="article-title">标题</label>
                    <input type="text" name="title" class="form-control" id="article-title">
                </div>
                <div class="form-group">
                    <label for="article-content">内容
                        <textarea id="article-content" name="content" style="width:700px;height:300px;">
</textarea>
                    </label>
                </div>
                <input type="submit" class="btn btn-success" value="发布">
            </form>
        </div>
    </div>
{% endblock %}

{% block ext_js %}
    <script src="/static/editor/kindeditor-all-min.js"></script>
    <script>
        KindEditor.ready(function (K) {
            window.editor = K.create('#article-content', {
                width: 1100,
                height: 600,
                uploadJson: '/blogsystem/upload_img_add_article/',
                extraFileUploadParams: {"csrfmiddlewaretoken": $("[name=csrfmiddlewaretoken]").val()},
                filePostName: 'img_article'
            });
        });
    </script>
{% endblock %}